package springbook.learningtest.template;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import java.io.IOException;

import org.junit.Before;
import org.junit.Test;

public class CalcSumTest {
	Calculator calculators = null;
	String filepath = null;
	@Before
	public void setUp() {
		calculators = new Calculator();
		
		filepath = this.getClass().getResource("numbers.txt").getPath();
	}
	
	@Test
	public void sumOfNumber() throws IOException {
				
		assertThat(calculators.calcSum(filepath), is(10));
	}
	
	@Test
	public void multiplyOfNumber() throws IOException {
				
		assertThat(calculators.calcMultiply(filepath), is(24));
	}

	@Test
	public void concatenateStrings() throws IOException {
				
		assertThat(calculators.concatenateString(filepath), is("1234"));
	}

}
